package top.lfyao.designpattern.details.chainResponsibility;
/**
 * 向链上的具体处理者对象提交请求

 */
public class ChainClient {
    public static void main(String[] args) {


        Handler handler1 = new ConcreteHandler1();
        Handler handler2 = new ConcreteHandler2();
        Handler handler3 = new ConcreteHandler3();
        handler1.setSuccessor(handler2);
        handler2.setSuccessor(handler3);
        for (int i = 0; i < 10; i++) {
            int request = (int) (Math.random() * 31);
            handler1.handlerRequest(request);
        }
    }
}
